package cn.tedu.spring.life;

import java.util.concurrent.CopyOnWriteArrayList;

public class CategoryService {

    private CopyOnWriteArrayList<String> list;

    public void init(){
        list=new CopyOnWriteArrayList<>();
        list.add("家电");
        list.add("食品");
        list.add("服装");
        System.out.println("初始化完成："+list);
    }

    public void destroy(){
        list.clear();
        System.out.println("list已销毁");
    }
}
